package jdbc.domian;

import java.sql.*;

/**
 * Created by guo on 2017/9/12.
 */
public class User {
    private  int id;
    private  String  username;
    private  String password;
    private String email;
    private  String phone;

    public User(int id, String username, String password, String email, String phone) {
        this.id = id;
        this.username = username;
        this.password = password;
        this.email = email;
        this.phone = phone;
    }

    public User() {
    }

    public int getId() {
        return id;
    }

    public void setId(int id) {
        this.id = id;
    }

    public String getUsername() {
        return username;
    }

    public void setUsername(String username) {
        this.username = username;
    }

    public String getPassword() {
        return password;
    }

    public void setPassword(String password) {
        this.password = password;
    }

    public String getEmail() {
        return email;
    }

    public void setEmail(String email) {
        this.email = email;
    }

    public String getPhone() {
        return phone;
    }

    public void setPhone(String phone) {
        this.phone = phone;
    }

    @Override
    public String toString() {
        return "User{" +
                "id=" + id +
                ", username='" + username + '\'' +
                ", password='" + password + '\'' +
                ", email='" + email + '\'' +
                ", phone='" + phone + '\'' +
                '}';
    }
}
    //    public static void main(String[] args) throws ClassNotFoundException, SQLException {
//        Class.forName("com.mysql.jdbc.Driver");
//        Connection con= DriverManager.getConnection("jdbc:mysql://localhost:3306/jdbc","root","root");
////       if(con!=null)
////       {
////           System.out.println("ok!");
////       }
////       else
////       {
////           System.out.println("error!");
////       }
//        Statement statement=con.createStatement();
//        String sql="select * from user";
//        ResultSet set=statement.executeQuery(sql);
//        while (set.next())
//        {
//            System.out.println(set.getInt(1)+","+set.getString(2)+","+set.getString(3)+","+set.getString(4)+","+set.getString(5));
//        }
//    }

